import {
	request
} from "@/utils/request.js"

export function apiGetBanner(data = {}) {
	return request({
		url: '/banner/selectPage',
		data,
	})
}

export function apiGetRandom(data = {}) {
	return request({
		url: '/goods/recommend',
		data,
	})
}

export function apiGetNotice(data = {}) {
	return request({
		url: '/notice/selectPage',
		data,
	})
}

export function apiGetClassify(data) {
	return request({
		url: '/category/selectPage',
		data
	})
}

export function apiGetClassList(data) {
	return request({
		url: '/goods/selectPage',
		data
	})
}


export function apiGetGoods(id) {
	return request({
		url: `/goods/selectById/${id}`,
	})
}



export function apiGoodsScore(data = {}) {
	return request({
		url: '/goods/update',
		method: 'PUT',
		data
	})
}


export function apiUpdateScore(data = {}) {
	return request({
		url: '/score/add',
		method: 'POST',
		data
	})
}

export function apiGetScore(data = {}) {
	return request({
		url: '/score/isScore',
		data
	})
}


export function apiGetScoreList(data = {}) {
	return request({
		url: '/score/selectPage',
		data
	})
}



export function apiWriteDownload(data = {}) {
	return request({
		url: '/download/add',
		method: 'POST',
		data
	})
}


export function apiGetDownload(data = {}) {
	return request({
		url: '/download/selectPage',
		data
	})
}


export function apiRegister(data = {}) {
	return request({
		url: '/wxLogin',
		method: 'POST',
		data
	})
}


export function apiUserInfo(data = {}) {
	return request({
		url: '/user/update',
		method: 'PUT',
		data
	})
}



export function apiSearyData(data = {}) {
	return request({
		url: '/goods/selectPage',
		data
	})
}

export function apiUserLogin(data = {}) {
	return request({
		url: '/login',
		method: 'POST',
		data
	})
}

export function apiUserRegister(data = {}) {
	return request({
		url: '/register',
		method: 'POST',
		data
	})
}

export function apiAvatar(data = {}) {
	return request({
		url: '/avatar/selectPage',
		data
	})
}


export function apiPosts(data = {}) {
	return request({
		url: '/posts/add',
		method: 'POST',
		data
	})
}

export function apiGetPosts(data = {}) {
	return request({
		url: '/posts/selectAll',
		data
	})
}

export function apiComments(data = {}) {
	return request({
		url: '/comments/add',
		method: 'POST',
		data
	})
}

export function apiCommentsPosts(id) {
	return request({
		url: `/comments/${id}`
	})
}


export function apiUser(id) {
	return request({
		url: `/user/selectById/${id}`
	})
}